﻿@model ProductsByTagModel
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title
    Html.AddTitleParts(string.Format(T("PageTitle.ProductsByTag").Text, Model.TagName));
}
@using Nop.Web.Models.Catalog;
@using Nop.Web.Extensions;
<div class="page product-tag-page">
    <div class="panel panel-default form-panel">
        <div class="panel-heading">
            <h3>@String.Format(T("Products.Tags.ProductsTaggedWith").Text, Model.TagName)</h3>
        </div>
        <div class="panel-body">
            <div class="page-body">
                @Html.Widget("productsbytag_top")
                <div class="row">
                    <div class="col-md-12">
                        <div class="product-selectors clearfix">
                            @*view mode*@
                            @if (Model.PagingFilteringContext.AllowProductViewModeChanging && Model.Products.Count > 0)
                            {
                                <div class="col-md-4 text-center">
                                    <div class="row">
                                        <div class="col-md-4 remove_right_padding">
                                            <span>@T("Catalog.ViewMode")</span>
                                        </div>
                                        <div class="col-md-5 remove_left_padding">
                                            @Html.DropDownList("products-viewmode", Model.PagingFilteringContext.AvailableViewModes, new { @class = "form-control dropdown-filter", onchange = "setLocation(this.value);" })
                                        </div>
                                    </div>
                                </div>
                            }
                            @*sorting*@
                            @if (Model.PagingFilteringContext.AllowProductSorting && Model.Products.Count > 0)
                            {
                                <div class="col-md-4 text-center">
                                    <div class="row">
                                        <div class="col-md-4 remove_right_padding">
                                            <span>@T("Catalog.OrderBy")</span>
                                        </div>
                                        <div class="col-md-8 remove_left_padding">
                                            @Html.DropDownList("products-orderby", Model.PagingFilteringContext.AvailableSortOptions, new { @class = "form-control dropdown-filter", onchange = "setLocation(this.value);" })
                                        </div>
                                    </div>
                                </div>
                            }
                            @*page size*@
                            @if (Model.PagingFilteringContext.AllowCustomersToSelectPageSize && Model.Products.Count > 0)
                            {
                                <div class="col-md-4 text-center">
                                    <div class="row">
                                        <div class="col-md-offset-2 col-md-3">
                                            <span>@T("Catalog.PageSize")</span>
                                        </div>
                                        <div class="col-md-3 remove_left_padding remove_right_padding">
                                            @Html.DropDownList("products-pagesize", Model.PagingFilteringContext.PageSizeOptions, new { @class = "form-control dropdown-filter", onchange = "setLocation(this.value);" })
                                        </div>
                                        <div class="col-md-4 remove_left_padding">
                                            <span>@T("Catalog.PageSize.PerPage")</span>
                                        </div>
                                    </div>
                                </div>
                            }
                        </div>
                    </div>
                </div>
                @Html.Widget("productsbytag_before_product_list")
                @*product list*@
                @if (Model.Products.Count > 0)
                {
                    if (Model.PagingFilteringContext.ViewMode == "list")
                    {
                        @*list mode*@
                        <div class="product-list">
                            @foreach (var product in Model.Products)
                            {
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="offer">
                                            @Html.Partial("_ProductBox", product)
                                        </div>
                                    </div>
                                </div>
                            }
                        </div>
                    }
                    else
                    {
                        @*grid mode*@
                        <div class="product-grid">
                            <div class="row">
                                @foreach (var product in Model.Products)
                                {

                                    <div class="col-md-4">
                                        <div class="offer">
                                            @Html.Partial("_ProductBox", product)
                                        </div>
                                    </div>

                                }
                            </div>
                        </div>
                    }
                }
                <div class="pager">
                    @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
                </div>
                @Html.Widget("productsbytag_bottom")
            </div>
        </div>
    </div>
    </div>
